import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'
import { Indicator } from 'mint-ui';
import qs from 'qs'
Vue.use(MintUI);
axios.defaults.baseURL="https://ele-interface.herokuapp.com/"
Vue.prototype.$axios=axios;

//请求拦截
axios.interceptors.request.use(config=>{
	if(config.method=="post"){
		config.data=qs.stringify(config.data)
		
	}
	//加载动画
	Indicator.open();
	// 在拦截请求之后一定要return出去
	return config;
},error=>{
	return Promise.reject(error);
})
//响应拦截
axios.interceptors.response.use(config=>{
	Indicator.close();
	return config
},Error=>{
	Indicator.close();
	return Promise.reject(Error);
})


Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
